/*
 * Copyright (c) 2018. paascloud.net All Rights Reserved.
 * 项目名称：paascloud快速搭建企业级分布式微服务平台
 * 类名称：UmsMemberFeignApi.java
 * 创建人：刘兆明
 * 联系方式：paascloud.net@gmail.com
 * 开源地址: https://github.com/paascloud
 * 博客地址: http://blog.paascloud.net
 * 项目官网: http://paascloud.net
 */

package com.choichumgming.rentcat.service;


import com.choichumgming.rentcat.common.api.CommonResult;
import com.choichumgming.rentcat.dto.MemberDetails;
import com.choichumgming.rentcat.model.UmsMember;
import com.choichumgming.rentcat.service.hystrix.UmsMemberFeignApiHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName UmsMemberFeignApi
 * @Description :  ums服务暴露的api接口服务
 * @Author : choichumgming
 * @Date : 27/2/2020 21:47
*/
@FeignClient(value = "rentcat-provider-ums", fallback = UmsMemberFeignApiHystrix.class)
public interface UmsMemberFeignApi {

	/**
	 * 根据userId获取用户
	 *
	 */
	@RequestMapping(value = "/api/user/item")
	CommonResult<UmsMember> getByUserId(@RequestParam("userId") Long userId);

	/**
	 * 根据username获取用户
	 *
	 */
	@RequestMapping(value = "/api/loadUserByUsername")
	CommonResult<MemberDetails> loadUserByUsername(@RequestParam("username")String username);

}
